// app.js
App({
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    }),
    setInterval(()=>{
    },30000)
  },

  getUserInfo() {
      let user = this.globalData.userInfo
      if (!user || !user.userNo) {
        user = wx.getStorageSync("userInfo")
      }
      return user
  },
 
  globalData: {
    baseUrl: 'https://diyaokeji.com.cn/khyMobile',
    nginxIp:"https://diyaokeji.com.cn/files",
    uploadServer: 'https://diyaokeji.com.cn/khyMobile/SysUploadController/up', //默认文件上
    //baseUrl: 'http://127.0.0.1:9091/khyMobile',
    //nginxIp:"http://127.0.0.1:9091/files",
    //uploadServer: 'http://127.0.0.1:9091/khyMobile/SysUploadController/up', //默认文件上传后台方法
    userInfo: null,
    paramDictCode: 'rPAX3jDkWqq',
    outerPackTypeDictCode: 'rPAUZZckWqq',
    basePrice: 10,//运输费底价
    diffValue: 6000,//体积转换重量的差值
    incrementPrice: 2,//每公斤续重价格
    maxInsureValue: 20000,//保价声明最大价值
    insureRate: 0.02,//保价费用比例
    storageRate: 0.2,//保管费率20%
    dictData: {
      payMode: [{label:'现付', value: '1'},{label:'到付', value: '2'}],
      insureStatus: [{label:'否', value: '0'},{label:'是', value: '1'}],
      payState: [{label:'否', value: '0'},{label:'是', value: '1'}],
      isDiscount: [{label:'否', value: '0'},{label:'是', value: '1'}],//是否使用新人注册优惠
      couponStatus: [{label:'可使用', value: '1'},{label:'已使用', value: '2'},{label:'已过期', value: '3'}],//优惠卷状态
      packageState: [{label:'已下单', value: '0'},{label:'已揽收', value: '1'},{label:'运输中', value: '2'},{label:'已送达', value: '3'},{label:'已签收', value: '4'},{label:'已取消', value: '5'}],
      transportState: [{label:'已揽收', value: '1'},{label:'运输中', value: '2'},{label:'已送达', value: '3'}],
      invoiceStatus: [{label:'已申请', value: '1'},{label:'已开票', value: '2'}],
      goodsType: [{label:'票据', value: '1'},{label:'证件', value: '2'},{label:'信件', value: '3'},{label:'其他', value: '4'}],
      outerPackType: [{label:'无', value: '6'},{label:'信封', value: '1'},{label:'档案袋', value: '2'},{label:'纸箱(大)', value: '3'},{label:'纸箱(中)', value: '4'},{label:'纸箱(小)', value: '5'}]
    },
    pageData: {}
  }
})
